﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI.WebControls;
using System.Web.UI;

/// <summary>
///MultiTextEditShow 的摘要说明
/// </summary>
public class MultiTextEditShow:BaseEditShowField
{
	public MultiTextEditShow()
	{
		//
		//TODO: 在此处添加构造函数逻辑
		//
	}

    public override IEnumerable<System.Web.UI.Control> GetThisTypeControl(ConfigColumns cCol, string value, bool isEdit)
    {
        TextBox ctrl = new TextBox();
        ctrl.ID = cCol.ColumnName + "_EditShow";
        ctrl.ValidationGroup = "Edit";
        ctrl.TextMode = TextBoxMode.MultiLine;
        if (!string.IsNullOrEmpty(cCol.EditShowTextBoxWidth))
        {
            ctrl.Width = new Unit(cCol.EditShowTextBoxWidth);
        }

        if (isEdit)
        {
            ctrl.Text = value.DecodeScript();
        }
        else
        {
            ctrl.Text = cCol.AddShowDefaultValue;
        }

        yield return ctrl;

        foreach (Control c in ValidataUI.GetValidata(cCol))
        {
            yield return c;
        }
    }
}
